//
//  TWAuthorHeaderView.swift
//  EyepetizerImitative
//
//  Created by 田伟 on 2017/4/19.
//  Copyright © 2017年 个人. All rights reserved.
//

import UIKit
import SDWebImage

class TWAuthorHeaderView: UIView {
    
    @IBOutlet weak var iconImageView: UIImageView!
    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var briefLabel: UILabel!
    @IBOutlet weak var attentionButton: UIButton!
    @IBOutlet weak var tw_discriptionLabel: UILabel!

//    @IBOutlet weak var subTitleView: TWTitleView!
    
    var model : TWPgcInfoModel?{
        didSet {
            guard let model = model else {
                return
            }
            iconImageView.sd_setImage(with: URL(string: model.icon!))
            nameLabel.text = model.name
            briefLabel.text = model.brief
            tw_discriptionLabel.text = model.tw_description
            
            attentionButton.layer.masksToBounds = true
            attentionButton.layer.cornerRadius = 4
            attentionButton.layer.borderWidth = 1
            attentionButton.layer.borderColor = UIColor.black.cgColor

        }
    }
    
    
    // 从xib中加载
    class func createAuthorHeaderView() -> TWAuthorHeaderView {
        return Bundle.main.loadNibNamed("TWAuthorHeaderView", owner: nil, options: nil)!.first as! TWAuthorHeaderView
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)

    }
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
}
